package org.phoenixframework.api.sys.config.spring;

import com.fasterxml.jackson.databind.SerializationFeature;
import feign.Request;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created by IntelliJ IDEA.
 *
 * @author doublelife
 * Date: 2020/3/11
 * Time: 14:55
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Bean
    Request.Options feignOptions() {
        return new Request.Options();
    }

    @Bean
    public Jackson2ObjectMapperBuilderCustomizer customizer(){
        return builder -> builder.featuresToEnable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
    }

}
